<?php


namespace App\Http\ModelDao\Flow;
use App\Enum\ClassListPayResultHistoryEnum;


class ClassListPayResultHistoryDao
{
    public static function classPayResultHistoryList($classPayHistoryObj)
    {
        $res = [];
        foreach ($classPayHistoryObj as & $payRecord) {
            $payRecord = (array) $payRecord;
            $res[] = [
                'push_time' => $payRecord['push_time'], //推送时间
                'city_name' => $payRecord['city_name'], //城市
                'ledger_subject_name' => $payRecord['ledger_subject_name'], //主体
                'class_id' => $payRecord['class_id'], //班级ID
                'class_name' => $payRecord['class_name'], //班级名称
                'statistic_date' => $payRecord['statistic_date'], //汇总日期（数仓计算时间）
                'pay_num' => $payRecord['pay_num'], //当日缴费笔数
                'pay_amt' => $payRecord['pay_amt'], //当日缴费课程金额
                'pay_fee' => $payRecord['pay_fee'], //当日缴费手续费
                'refund_num' => $payRecord['refund_num'], //当日退费笔数
                'refund_amt' => $payRecord['refund_amt'], //当日退费课程金额
                'refund_fee' => $payRecord['refund_fee'], //当日退费手续费
                'account_netting' => $payRecord['account_netting'], //当日轧差金额
                'total_pay_num' => $payRecord['total_pay_num'], //截止当日缴费总笔数
                'total_pay_amt' => $payRecord['total_pay_amt'], //截止当日总缴费金额
                'total_pay_fee' => $payRecord['total_pay_fee'], //截止当日缴费总手续费
                'total_refund_num' => $payRecord['total_refund_num'], //截止当日退费总笔数
                'total_refund_amt' => $payRecord['total_refund_amt'], //截止当日总退费金额
                'total_refund_fee' => $payRecord['total_refund_fee'], //截止当日退费总手续费
                'result' => in_array($payRecord['result'], array_keys(ClassListPayResultHistoryEnum::$push_status)) ? ClassListPayResultHistoryEnum::$push_status[$payRecord['result']] : '未知', //推送状态
                'result_desc' => $payRecord['result_desc'], //描述信息
            ];
        }

        return $res;
    }
}
